package net.j4love.algorithm.chapter1;

/**
 * union-find 算法 , 动态连通性问题
 * @author he peng
 * @create 2017/10/9 17:13
 * @see
 */
public class UF {

    private int[] id;   // 分量id(以触电作为索引)
    private int count;  // 分量数量

    public UF(int n) {
        this.count = n;
        this.id = new int[n];
        for (int i = 0 ; i < n ; i++) {
            this.id[i] = i;
        }
    }

    public int count() {
        return this.count;
    }

    public boolean connected(int p,int q) {
        return false;
    }
}
